package strex;

/**
 * @author: knowno
 * @create: 2025-09-15 08:35
 * @Version 1.0
 **/
public class TestString4 {
    public static void main(String[] args) {

//        String sql = "select * from user where id = 1";
//        System.out.println(sql);
//        for (int i = 0; i < 10; i++) {
//            if ...
//                sql = "select * from user where id = " + i;
//                System.out.println(sql);
//            }
//        }

        //可变性  长度和内容都可以改变 (频繁进行字符串处理,例如sql: 动态sql的拼接)
//        StringBuffer sql = new StringBuffer("select * from user where id = 1");
//        System.out.println(sql);
//        for (int i = 0; i < 10; i++) {
//            if ...
//            sql.append("select * from user where id = " + i;
//            System.out.println(sql);
//        }
//    }


    }
}
